<?php
/**
 * 油气站列表
 */
namespace App\Controller;

use Think\Controller;

class StationController extends Controller {

    public  $page_num = 10;
    private $m_sale,$m_sale_good;

	public function _initialize() {
        $this->m_sale = D("Admin/Sale");
        $this->m_sale_good = D("Sale/SaleGood");
	}
    /**
     *  消费机构列表
     */
    public function sale_lists() {
        $list = $this->m_sale->get_list();

        $this->successReturn($list);
    }


    /**
     * 消费机构详情
     */
    public function sale_detail() {
        $detail_id = I("post.detail_id");
        if(empty($detail_id)){
            $this->errorReturn("请输入油气站ID");
        }
        $where = ['id'=>$detail_id];
        $item = $this->m_sale->get_list($where);
        if(empty($item)){
            $this->errorReturn("该油气站不存在！");
        }else{
            $this->successReturn($item[0]);
        }
    }




}

